<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>生成业务表字段</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form  action="gentablecolumn/${action eq "create" ?"save":"update"}" name="inputForm" id="inputForm" method="post" class="form-horizontal">
        <input name="id" id="id" value="${entity.id}" type="hidden" />


        <div class="form-group">
            <label class="col-sm-1 control-label">业务表id：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="genTableId" value="${entity.genTableId}" placeholder="业务表id">
            </div>
            <label class="col-sm-1 control-label">列名：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="columnName" value="${entity.columnName}" placeholder="列名">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">列描述：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="columnRemark" value="${entity.columnRemark}" placeholder="列描述">
            </div>
            <label class="col-sm-1 control-label">字段类型：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="columnType" value="${entity.columnType}" placeholder="字段类型">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">jdbc类型：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="jdbcType" value="${entity.jdbcType}" placeholder="jdbc类型">
            </div>
            <label class="col-sm-1 control-label">java类型：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="javaType" value="${entity.javaType}" placeholder="java类型">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">java字段名：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="javaField" value="${entity.javaField}" placeholder="java字段名">
            </div>
            <label class="col-sm-1 control-label">主键：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="isPk" value="${entity.isPk}" placeholder="主键">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">插入：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="isInsert" value="${entity.isInsert}" placeholder="插入">
            </div>
            <label class="col-sm-1 control-label">编辑：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="isRequire" value="${entity.isRequire}" placeholder="编辑">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">列表：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="isList" value="${entity.isList}" placeholder="列表">
            </div>
            <label class="col-sm-1 control-label">查看：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="isInfo" value="${entity.isInfo}" placeholder="查看">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">查询：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="isQuery" value="${entity.isQuery}" placeholder="查询">
            </div>
            <label class="col-sm-1 control-label">查询匹配方式：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="compareType" value="${entity.compareType}" placeholder="查询匹配方式">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">表单类型：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="formType" value="${entity.formType}" placeholder="表单类型">
            </div>
            <label class="col-sm-1 control-label">字典类型：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="dicType" value="${entity.dicType}" placeholder="字典类型">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-1 control-label">排序：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="sortNum" value="${entity.sortNum}" placeholder="排序">
            </div>
            <label class="col-sm-1 control-label">排序：</label>
            <div class="col-md-4">
                <input type="text" class="form-control" name="sortNum" value="${entity.sortNum}" placeholder="排序">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-1 col-sm-2">
                <button id="saveBtn" type="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> 提交</button>
                <button type="button" class="btn btn-sm link_close"><i class="fa fa-close"></i> 关闭</button>
            </div>
        </div>
    </form>
</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var options = {
            rules:{
                genTableId:{required:true},
                columnName:{required:true},
                columnRemark:{required:true},
                columnType:{required:true},
                jdbcType:{required:true},
                javaType:{required:true},
                javaField:{required:true},
                isPk:{required:true},
                isInsert:{required:true},
                isRequire:{required:true},
                isList:{required:true},
                isInfo:{required:true},
                isQuery:{required:true},
                compareType:{required:true},
                formType:{required:true},
                dicType:{required:true},
                sortNum:{required:true}
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.success){
                            $('#searchBtn', parent.document).click();
                            closeIframe();
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                });
            }
        };
        $("#inputForm").validate(options);
    });
</script>
<!-- script end -->
</body>
</html>
